<html>

<script>
    window.onload = function () {
        let ws = new WebSocket('ws://127.0.0.1:9502');
        ws.onopen = function () {
            ws.send('the request from client');
        };
        ws.onmessage = function (e) {
            console.log('from server: ' + e.data);
        };

    }
</script>

</html>

